using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using BTOps;

public partial class BTOps_Application : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void grdApplications_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        GridViewRow row = e.Row;
        if (row.RowType == DataControlRowType.DataRow)
        {
            BTApplication app = (BTApplication)row.DataItem;
            HyperLink lnkOrchestration = row.FindControl("lnkOrchestration") as HyperLink;
            if (null != lnkOrchestration)
                lnkOrchestration.Visible = (app.Orchestrations.Length > 0);
            HyperLink lnkReceivePort = row.FindControl("lnkReceivePort") as HyperLink;
            if (null != lnkReceivePort)
                lnkReceivePort.Visible = (app.ReceivePorts.Length > 0);
            HyperLink lnkSendPort = row.FindControl("lnkSendPort") as HyperLink;
            if (null != lnkSendPort)
                lnkSendPort.Visible = (app.SendPorts.Length > 0);
            HyperLink lnkSchema = row.FindControl("lnkSchema") as HyperLink;
            if (null != lnkSchema)
                lnkSchema.Visible = (app.Schemas.Length > 0);
            HyperLink lnkPipeline = row.FindControl("lnkPipeline") as HyperLink;
            if (null != lnkPipeline)
                lnkPipeline.Visible = (app.Pipelines.Length > 0);
        }
    }
}